﻿using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xpedite.Config;
using Xpedite.Resources.Minifiers;

namespace Xpedite.Test.Config
{
  [TestClass]
  public class ConfigSectionHandlerTest
  {
    [TestMethod]
    public void TestCanParseDefinedConfig()
    {
      var configSection = ConfigSectionHandler.Instance;

      Assert.AreEqual(ConfigMode.On, configSection.Mode);
      Assert.AreEqual(typeof(DefaultMinifier), configSection.Css.Minifier);
      Assert.AreEqual(typeof(DefaultMinifier), configSection.JavaScript.Minifier);
    }

    [Ignore]
    [TestMethod]
    public void TestCanParseMissingConfig()
    {
      var configSection = ConfigSectionHandler.Instance;

      Assert.AreEqual(ConfigMode.RemoteOnly, configSection.Mode);
      Assert.AreEqual(typeof(DefaultMinifier), configSection.Css.Minifier);
      Assert.AreEqual(typeof(DefaultMinifier), configSection.JavaScript.Minifier);
    }
  }
}
